home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / Palettes.h < prev    next >
Text File  |  1995-07-06  |  6KB  |  167 lines

  1. /*
  2.      File:        Palettes.h
  3.  
  4.      Contains:    Palette Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __PALETTES__
  21. #define __PALETTES__
  22.  
  23.  
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27. /*    #include <Types.h>                                            */
  28. /*        #include <ConditionalMacros.h>                            */
  29. /*    #include <MixedMode.h>                                        */
  30. /*    #include <QuickdrawText.h>                                    */
  31.  
  32. #ifndef __WINDOWS__
  33. #include <Windows.h>
  34. #endif
  35. /*    #include <Memory.h>                                            */
  36. /*    #include <Events.h>                                            */
  37. /*        #include <OSUtils.h>                                    */
  38. /*    #include <Controls.h>                                        */
  39. /*        #include <Menus.h>                                        */
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. #if PRAGMA_ALIGN_SUPPORTED
  46. #pragma options align=mac68k
  47. #endif
  48.  
  49. #if PRAGMA_IMPORT_SUPPORTED
  50. #pragma import on
  51. #endif
  52.  
  53.  
  54. enum {
  55.     pmCourteous                    = 0,                            /*Record use of color on each device touched.*/
  56.     pmTolerant                    = 0x0002,                        /*render ciRGB if ciTolerance is exceeded by best match.*/
  57.     pmAnimated                    = 0x0004,                        /*reserve an index on each device touched and render ciRGB.*/
  58.     pmExplicit                    = 0x0008,                        /*no reserve, no render, no record; stuff index into port.*/
  59.     pmWhite                        = 0x0010,
  60.     pmBlack                        = 0x0020,
  61.     pmInhibitG2                    = 0x0100,
  62.     pmInhibitC2                    = 0x0200,
  63.     pmInhibitG4                    = 0x0400,
  64.     pmInhibitC4                    = 0x0800,
  65.     pmInhibitG8                    = 0x1000,
  66.     pmInhibitC8                    = 0x2000,
  67. /* NSetPalette Update Constants */
  68.     pmNoUpdates                    = 0x8000,                        /*no updates*/
  69.     pmBkUpdates                    = 0xA000,                        /*background updates only*/
  70.     pmFgUpdates                    = 0xC000,                        /*foreground updates only*/
  71.     pmAllUpdates                = 0xE000                        /*all updates*/
  72. };
  73.  
  74. struct ColorInfo {
  75.     RGBColor                        ciRGB;                        /*true RGB values*/
  76.     short                            ciUsage;                    /*color usage*/
  77.     short                            ciTolerance;                /*tolerance value*/
  78.     short                            ciDataFields[3];            /*private fields*/
  79. };
  80. typedef struct ColorInfo ColorInfo;
  81.  
  82. struct Palette {
  83.     short                            pmEntries;                    /*entries in pmTable*/
  84.     short                            pmDataFields[7];            /*private fields*/
  85.     ColorInfo                        pmInfo[1];
  86. };
  87. typedef struct Palette Palette, *PalettePtr, **PaletteHandle;
  88.  
  89. extern pascal void InitPalettes(void)
  90.  ONEWORDINLINE(0xAA90);
  91. extern pascal PaletteHandle NewPalette(short entries, CTabHandle srcColors, short srcUsage, short srcTolerance)
  92.  ONEWORDINLINE(0xAA91);
  93. extern pascal PaletteHandle GetNewPalette(short PaletteID)
  94.  ONEWORDINLINE(0xAA92);
  95. extern pascal void DisposePalette(PaletteHandle srcPalette)
  96.  ONEWORDINLINE(0xAA93);
  97. extern pascal void ActivatePalette(WindowPtr srcWindow)
  98.  ONEWORDINLINE(0xAA94);
  99. extern pascal void SetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, Boolean cUpdates)
  100.  ONEWORDINLINE(0xAA95);
  101. extern pascal void NSetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, short nCUpdates)
  102.  ONEWORDINLINE(0xAA95);
  103. extern pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  104.  ONEWORDINLINE(0xAA96);
  105. extern pascal void CopyPalette(PaletteHandle srcPalette, PaletteHandle dstPalette, short srcEntry, short dstEntry, short dstLength)
  106.  ONEWORDINLINE(0xAAA1);
  107. extern pascal void PmForeColor(short dstEntry)
  108.  ONEWORDINLINE(0xAA97);
  109. extern pascal void PmBackColor(short dstEntry)
  110.  ONEWORDINLINE(0xAA98);
  111. extern pascal void AnimateEntry(WindowPtr dstWindow, short dstEntry, const RGBColor *srcRGB)
  112.  ONEWORDINLINE(0xAA99);
  113. extern pascal void AnimatePalette(WindowPtr dstWindow, CTabHandle srcCTab, short srcIndex, short dstEntry, short dstLength)
  114.  ONEWORDINLINE(0xAA9A);
  115. extern pascal void GetEntryColor(PaletteHandle srcPalette, short srcEntry, RGBColor *dstRGB)
  116.  ONEWORDINLINE(0xAA9B);
  117. extern pascal void SetEntryColor(PaletteHandle dstPalette, short dstEntry, const RGBColor *srcRGB)
  118.  ONEWORDINLINE(0xAA9C);
  119. extern pascal void GetEntryUsage(PaletteHandle srcPalette, short srcEntry, short *dstUsage, short *dstTolerance)
  120.  ONEWORDINLINE(0xAA9D);
  121. extern pascal void SetEntryUsage(PaletteHandle dstPalette, short dstEntry, short srcUsage, short srcTolerance)
  122.  ONEWORDINLINE(0xAA9E);
  123. extern pascal void CTab2Palette(CTabHandle srcCTab, PaletteHandle dstPalette, short srcUsage, short srcTolerance)
  124.  ONEWORDINLINE(0xAA9F);
  125. extern pascal void Palette2CTab(PaletteHandle srcPalette, CTabHandle dstCTab)
  126.  ONEWORDINLINE(0xAAA0);
  127. extern pascal long Entry2Index(short entry)
  128.  TWOWORDINLINE(0x7000, 0xAAA2);
  129. extern pascal void RestoreDeviceClut(GDHandle gd)
  130.  TWOWORDINLINE(0x7002, 0xAAA2);
  131. extern pascal void ResizePalette(PaletteHandle p, short size)
  132.  TWOWORDINLINE(0x7003, 0xAAA2);
  133. extern pascal void SaveFore(ColorSpec *c)
  134.  THREEWORDINLINE(0x303C, 0x040D, 0xAAA2);
  135. extern pascal void SaveBack(ColorSpec *c)
  136.  THREEWORDINLINE(0x303C, 0x040E, 0xAAA2);
  137. extern pascal void RestoreFore(const ColorSpec *c)
  138.  THREEWORDINLINE(0x303C, 0x040F, 0xAAA2);
  139. extern pascal void RestoreBack(const ColorSpec *c)
  140.  THREEWORDINLINE(0x303C, 0x0410, 0xAAA2);
  141. extern pascal OSErr SetDepth(GDHandle gd, short depth, short whichFlags, short flags)
  142.  THREEWORDINLINE(0x303C, 0x0A13, 0xAAA2);
  143. extern pascal short HasDepth(GDHandle gd, short depth, short whichFlags, short flags)
  144.  THREEWORDINLINE(0x303C, 0x0A14, 0xAAA2);
  145. extern pascal short PMgrVersion(void)
  146.  TWOWORDINLINE(0x7015, 0xAAA2);
  147. extern pascal void SetPaletteUpdates(PaletteHandle p, short updates)
  148.  THREEWORDINLINE(0x303C, 0x0616, 0xAAA2);
  149. extern pascal short GetPaletteUpdates(PaletteHandle p)
  150.  THREEWORDINLINE(0x303C, 0x0417, 0xAAA2);
  151. extern pascal Boolean GetGray(GDHandle device, const RGBColor *backGround, RGBColor *foreGround)
  152.  THREEWORDINLINE(0x303C, 0x0C19, 0xAAA2);
  153.  
  154. #if PRAGMA_IMPORT_SUPPORTED
  155. #pragma import off
  156. #endif
  157.  
  158. #if PRAGMA_ALIGN_SUPPORTED
  159. #pragma options align=reset
  160. #endif
  161.  
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165.  
  166. #endif /* __PALETTES__ */
  167.